def run(params:list[str]):    
    from ApiTools import apiBase
    try:
        agent_name=apiBase.argv(params,1,'sql-convert')
        code=apiBase.argv(params,2,'select * from Project where "ProjectID" >0')        
        agent=apiBase.agent_find(agent_name)
        if not agent:
            return "Agent is None"
        quest={}
        quest["output"]={"messages": [("user", code)]}
        quest['error']=None
        quest['curNodeName']='__start__'
        ret=agent.invoke({"aggregate": [quest], "curNodeName": quest['curNodeName'],"output":"","score":""})
        import json
        val=json.dumps(ret,ensure_ascii=False)
        return val
    except Exception as e:
        return f"function error:{e}"